package model;

import java.awt.Color;
import java.util.Observable;

import view.SlotView;
import xl.Address;

public class CurrentSlot extends Observable {
	private SlotView current;
	
	public CurrentSlot() {
		
	}
	
	public void setCurrent(SlotView slot) {
		current = slot;
	}
	
	public SlotView getCurrent() {
		return current;
	}
	
	public void updateCurrent(SlotView newSlot) {
		current.setBackground(Color.WHITE);
		newSlot.setBackground(Color.YELLOW);
		setCurrent(newSlot);
		setChanged();
		notifyObservers(newSlot.getAddress());
	}
	
	public void updateContents(String newContents){
		current.setText(newContents);
	}
}
